{% extends "base.html" %}
{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% load ietf_filters static %}
{% load cache %}
{% block pagehead %}
    <link rel="stylesheet" href="{% static "ietf/css/list.css" %}">
{% endblock %}
{% block title %}Past Meetings{% endblock %}
{% block content %}
    {% cache 3600 pastmeetings %}
    {% origin %}
    <h1>Past Meetings</h1>
    {% if meetings %}
        <table class="table table-sm table-striped tablesorter">
            <thead>
                <tr>
                    <th scope="col" data-sort="date">Date</th>
                    <th scope="col" data-sort="group">Group</th>
                    <th scope="col" data-sort="name">Name</th>
                    <th scope="col" class="d-none d-sm-table-cell"></th>
                </tr>
            </thead>
            <tbody>
                {% for meeting in meetings %}
                    <tr>
                        <td>{{ meeting.date }}</td>
                        <td>
                            {% if meeting.responsible_group.type_id != 'ietf' %}
                                <a href="{% url 'ietf.group.views.group_home' meeting.responsible_group.acronym %}">
                                    {{ meeting.responsible_group.acronym }}
                                </a>
                            {% else %}
                                {{ meeting.responsible_group.acronym }}
                            {% endif %}
                        </td>
                        <td>
                            {% if meeting.type_id == "interim" %}
                                <a href="{% url 'ietf.meeting.views.session_details' num=meeting.number acronym=meeting.responsible_group.acronym %}">{{ meeting.number }}</a>
                                {% if meeting.interim_meeting_cancelled %}<span class="badge rounded-pill text-bg-warning">Cancelled</span>{% endif %}
                            {% else %}
                                {% if meeting.get_number > 28 %}
                                    <a href="{% url 'agenda' num=meeting.number %}">IETF-{{ meeting.number }}</a>
                                {% else %}
                                    <a href="https://www.ietf.org/proceedings/{{meeting.get_number|stringformat:'02d'}}.pdf">IETF-{{ meeting.number }}</a>
                                {% endif %}
                            {% endif %}
                        </td>
                        <td class="d-none d-sm-table-cell">
                            {% if meeting.type_id == "interim" %}
                            {% else %}
                                {% if meeting.get_number > 97 %}
                                    <a href="{% url 'ietf.meeting.views.important_dates' num=meeting.number %}">Important dates</a>
                                {% endif %}
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <h2>No past meetings</h2>
    {% endif %}
    {% endcache %}
{% endblock %}
{% block js %}
    <script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}